#include <cmath>

/* pt class begins here */

#define _Ty double
class pt
{
public:
    _Ty x, y;
    pt (_Ty _x = 0, _Ty _y = 0)
    {
        x = _x, y = _y;
    }
};
 
pt operator + (pt a, pt b)
{   return pt(a.x + b.x, a.y + b.y); }
pt operator - (pt a, pt b)
{   return pt(a.x - b.x, a.y - b.y); }
pt operator - (pt a)
{   return pt() - a; }
_Ty operator * (pt a, pt b)
{   return a.x * b.x + a.y * b.y; }
_Ty operator & (pt a, pt b)
{   return a.x * b.y - a.y * b.x; }
pt operator * (pt a, _Ty q)
{   return pt(a.x * q, a.y * q); }
pt operator / (pt a, _Ty q)
{   return a * (1 / q); }
_Ty abs(pt a)
{   return sqrt(a * a); }
_Ty dist(pt a, pt b)
{   return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)); }
pt rotate(pt a, long double angle)
{	return pt(a.x * cos (angle) - a.y * sin(angle), a.x * sin(angle) + a.y * cos(angle)); }

/* pt class ends  here */
